package com.aaa.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 统一地区库
 * @TableName crs_base_area
 */
@ApiModel(description = "统一地区库")
@TableName(value ="crs_base_area")
@Data
public class BaseArea implements Serializable {
    /**
     * 地址ID
     */
    @ApiModelProperty("地址ID")
    private Integer baseAreaid;

    /**
     * 地区名字
     */
    @ApiModelProperty("地区名字")
    private String name;

    /**
     * 上级路径ID
     */
    @ApiModelProperty("上级路径ID")
    @TableId(value = "parentid",type = IdType.AUTO)
    private Integer parentid;

    /**
     * 顺序
     */
    @ApiModelProperty("顺序")
    private Integer vieworder;

    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BaseArea other = (BaseArea) that;
        return (this.getBaseAreaid() == null ? other.getBaseAreaid() == null : this.getBaseAreaid().equals(other.getBaseAreaid()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getParentid() == null ? other.getParentid() == null : this.getParentid().equals(other.getParentid()))
            && (this.getVieworder() == null ? other.getVieworder() == null : this.getVieworder().equals(other.getVieworder()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBaseAreaid() == null) ? 0 : getBaseAreaid().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getParentid() == null) ? 0 : getParentid().hashCode());
        result = prime * result + ((getVieworder() == null) ? 0 : getVieworder().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", baseAreaid=").append(baseAreaid);
        sb.append(", name=").append(name);
        sb.append(", parentid=").append(parentid);
        sb.append(", vieworder=").append(vieworder);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}